package com.huwang.greendao.gen;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.example.huwang.model.CaseBean;
import com.example.huwang.model.DefinitionBean;
import com.example.huwang.model.HistoryBean;
import com.example.huwang.model.LoginBean;

import com.huwang.greendao.gen.CaseBeanDao;
import com.huwang.greendao.gen.DefinitionBeanDao;
import com.huwang.greendao.gen.HistoryBeanDao;
import com.huwang.greendao.gen.LoginBeanDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig caseBeanDaoConfig;
    private final DaoConfig definitionBeanDaoConfig;
    private final DaoConfig historyBeanDaoConfig;
    private final DaoConfig loginBeanDaoConfig;

    private final CaseBeanDao caseBeanDao;
    private final DefinitionBeanDao definitionBeanDao;
    private final HistoryBeanDao historyBeanDao;
    private final LoginBeanDao loginBeanDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        caseBeanDaoConfig = daoConfigMap.get(CaseBeanDao.class).clone();
        caseBeanDaoConfig.initIdentityScope(type);

        definitionBeanDaoConfig = daoConfigMap.get(DefinitionBeanDao.class).clone();
        definitionBeanDaoConfig.initIdentityScope(type);

        historyBeanDaoConfig = daoConfigMap.get(HistoryBeanDao.class).clone();
        historyBeanDaoConfig.initIdentityScope(type);

        loginBeanDaoConfig = daoConfigMap.get(LoginBeanDao.class).clone();
        loginBeanDaoConfig.initIdentityScope(type);

        caseBeanDao = new CaseBeanDao(caseBeanDaoConfig, this);
        definitionBeanDao = new DefinitionBeanDao(definitionBeanDaoConfig, this);
        historyBeanDao = new HistoryBeanDao(historyBeanDaoConfig, this);
        loginBeanDao = new LoginBeanDao(loginBeanDaoConfig, this);

        registerDao(CaseBean.class, caseBeanDao);
        registerDao(DefinitionBean.class, definitionBeanDao);
        registerDao(HistoryBean.class, historyBeanDao);
        registerDao(LoginBean.class, loginBeanDao);
    }
    
    public void clear() {
        caseBeanDaoConfig.clearIdentityScope();
        definitionBeanDaoConfig.clearIdentityScope();
        historyBeanDaoConfig.clearIdentityScope();
        loginBeanDaoConfig.clearIdentityScope();
    }

    public CaseBeanDao getCaseBeanDao() {
        return caseBeanDao;
    }

    public DefinitionBeanDao getDefinitionBeanDao() {
        return definitionBeanDao;
    }

    public HistoryBeanDao getHistoryBeanDao() {
        return historyBeanDao;
    }

    public LoginBeanDao getLoginBeanDao() {
        return loginBeanDao;
    }

}
